// write your code here
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int[][] arr = new int[20][20];
            int n = 20;
            int index = 0;
            while(n!=0){
                String str = sc.next();
                for(int i = 0; i < 20;i++){
                    if(str.equals("+")) arr[index][i] = 2;
                    else if(str.equals("*")) arr[index][i] = 1;
                }
                index++;
                n--;
            }
            int a = 10;
            //System.out.println(Arrays.toString(arr));
            System.out.println(isFive(arr) == true?"Yes":"No");
        }
    }
    public static boolean isFive(int[][] arr){
        for(int i = 0; i < 20; i++){
            for(int j = 0; j < 20; j++){
                if(arr[i][j] == 0) continue;
                int r = 1;
                int rd = 1;
                int d = 1;
                int ld = 1;
                for(int k = 1; k < 5; k++){
                    if(j<16 && arr[i][j] == arr[i][j+k]){
                        r++;
                    }
                    if(i<16 && arr[i][j] == arr[i+k][j]){
                        d++;
                    }
                    if(i<16 && j<16 && arr[i][j] == arr[i+k][j+k]){
                        rd++;
                    }
                    if(i<16 && j>3 && arr[i][j] == arr[i+k][j-k]){
                        ld++;
                    }
                }
                if(rd==5||ld==5||d==5||r==5){
                    return true;
                }
            }
        }
        return false;
    }
}